/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.se2.meteocal.entity;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;


/**
 *
 * @author Ugo
 */

@Entity
@XmlAccessorType(XmlAccessType.NONE)
@NamedQueries({
    @NamedQuery(name = Location.CountByLocation, query = "SELECT l FROM Location l WHERE l.location = :location")  ,
    @NamedQuery(name = Location.findAll, query = "SELECT l FROM Location l")  

})
public class Location implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final String CountByLocation = "Location.CountByLocation";
    public static final String findAll = "Location.findAll";

    @Id
    @XmlAttribute
    private String location;
    
    public Location(){
        
    }
    
    public Location(String location){
        this.location=location;
    }  
    
    public String getLocation(){
        return this.location;
    }
    
    public void setLocation(String location){
        this.location=location;
    }
  
    
    @Override 
    public String toString()
    {
        return this.location;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Location other = (Location) obj;
        return Objects.equals(this.location, other.location);
    }
     
}
